#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1010,mod = 1e9+7;
int n,k,a[N],f[N][N],G[N][N],ans,b[N],c[N],fac[N],sum1,sum,o,cnt,o1;
inline int ksm(int x,int p)
{
	int ans = 1;
	while(p)
	{
		if((p&1)) ans = ans*x%mod;
		x = x*x%mod;
		p>>=1;
	}
	return ans;
}
inline void dfs(int x)
{
	if(x == k+1)
	{
		for(int i = 1;i <= n;i++) c[i] = a[i];
		o = n;
		for(int i = 1;i <= k;i++)
		{
			if(b[i] >= o) return;
			c[b[i]] -= c[b[i]+1];
			for(int j = b[i]+1;j < o;j++) c[j] = c[j+1];
			o--;
		}
		for(int i = 1;i <= n-k;i++) cnt+=c[i];
		return;
	}
	for(int i = 1;i <= n-x+1;i++)
		b[x] = i,dfs(x+1);
}
signed main()
{
    freopen("game.in","r",stdin);
    freopen("game.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n >> k; fac[0] = 1;
	for(int i = 1;i <= n;i++) cin >> a[i],fac[i] = fac[i-1]*i%mod;
	sum = fac[n-1]*ksm(fac[n-k-1],mod-2)%mod; 
	if(n <= 10)
	{
		dfs(1);
		cout<<(cnt*ksm(sum,mod-2)%mod+mod)%mod;
		return 0;
	}
	G[0][0] = 1;
	for(int i = 1;i <= n;i++)
		for(int j = 0;j <= min(i-1,k);j++)
			G[i][j] = fac[i-1]*ksm(fac[i-1-j],mod-2)%mod;
	for(int i = n;i >= 1;i--)
	{
		o = sum1 = c[i+1] = 0;
		for(int j = i;j >= 1;j--)
		{
			o++,c[j] = ((a[j]-a[j+1])%mod*fac[o-1]%mod+mod)%mod;
			if(i == j) f[j][i] = a[i]; 
			else f[j][i] = c[j];
			for(int z = 0;z <= k-(i-j);z++) ans = (ans+f[j][i]*G[j-1][z]%mod*G[n-i][k-(i-j)-z]%mod)%mod;
		}
	}
	cout<<ans*ksm(sum,mod-2)%mod;
    return 0;
}
